package com.neusoft.neu24g1.his5.entity;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.*;

import java.util.ArrayList;
import java.util.List;

/**
 * Doctor 医生实体
 *
 * @author Administrator
 * @version 2024/06/06 21:10
 **/
@Data

@AllArgsConstructor
public class Doctor {
    private static  int index = (int )System.currentTimeMillis() ;
    private   String  id ;
    private  String  name ="a";
    private  String logid ="b";
    private  String logpwd="c";
    private  String  phone="cd";
    private  String dept="dd";
    private  String clazz="dd";
    private  String workcode="dd";
    private String role ="asdasf";

    public  Doctor(){
        this.id = "id"  +  ( index++  );
    }

    public static void main(String[] args) throws JsonProcessingException {
        List<Doctor> lds =new ArrayList<>();
//        持久化
//        Oject -- 》  String  -- 》  写到硬盘上
        lds.add(new
                Doctor( ));
        lds.add(new
                Doctor( ));
        lds.add(new
                Doctor( ));
        lds.add(new
                Doctor( ));
        lds.add(new
                Doctor( ));
//        JSON

        ObjectMapper mapper =new ObjectMapper();
        String str =  mapper.writeValueAsString( lds );
        System.out.println(str);




    }

}